import Vue from "vue";
import Vuex from "vuex";

import mutations from "./mutations";
import actions from "./actions";
import getters from "./getters"
//1.安装插件
Vue.use(Vuex);
const state = {
  cartList: [],
};


//2.创建Store对象
const store = new Vuex.Store({
  state,
  mutations,
  //异步操作或者判断逻辑的操作放入actions中
  actions,
  getters
});

//3.挂载Vue实例上
export default store;
